<?php

/**
 * @author christian
 * @copyright 2011
 *  
 */

 //establecer una variable conratafisica $_LOCALHOST
$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDGuide";
include_once("$ruta/star.php");
//include_once("$ruta/MDTourGeneral/MDPasajeros/CPaxEdit.php");
//include_once("$rut/conf/CConfig.php");

//Campos de control
if (!isset($_POST['action'])) {$_POST['action'] = "NULL"; }
$action=$_POST['action'];

//Campos de registro
if (!isset($_POST['idActGuiTour'])) {$_POST['idActGuiTour'] = "NULL"; }
if (!isset($_POST['GasPre'])){$_POST['GasPre']= "NULL";;}
if (!isset($_POST['GasReal'])){$_POST['GasReal'] = "NULL";;}	
if (!isset($_POST['ActItems'])){$_POST['ActItems']= "NULL";;}
if (!isset($_POST['DayAct'])){$_POST['DayAct']= "NULL";;} 	 	
if (!isset($_POST['type'])){$_POST['type']= "NULL";;} 	
if (!isset($_POST['idPackTourGui'])){$_POST['idPackTourGui']= "NULL";;} 	


$idActGuiTour=$_POST['idActGuiTour'];
$GasReal=$_POST['GasReal'];
$ActItems = $_POST['ActItems'];
$GasPre =$_POST['GasPre']; 	 	
$DayAct =$_POST['DayAct']; 	
$actividades_idAct =$_POST['idAct']; 	
$idPackTourGui =$_POST['idPackTourGui']; 	 	
	 	





if($action==1){
 $query = "update guidetc_has_actividades idPackTourGui='$idPackTourGui', GasPre='$GasPre', GasReal='$GasREal', ActItems='$ActItems', DayAct='$DayAct', actividades_idAct='$actividades_idAct' 
  where idActGuiTour='$idActGuiTour'";
 
         CModelo::getInstance()->insertData($query);
        
        //echo "<script> parent.location.href = '/viventura/MDGuide/MDTourGeneral/MDPasajeros/MDPasajeros.php?codigo=2923' </script>";
        
        }
else{
    
    $insertar= "insert into guidetc_has_actividades (idActGuiTour, idPackTourGui, GasPre, GasReal, ActItems, DayAct, actividades_idAct) values
                 ('NULL','$idPackTourGui','$GasPre','$GasReal','$ActItems','$DayAct','$actividades_idAct')";
     
    echo $insertar;
    $idPax = CModelo::getInstance()->insertData($insertar);
    
     
//   echo "<script> parent.location.href = '/viventura/MDGuide/MDTourGeneral/MDPasajeros/CPaxEdit.php?codigo=$idTour&action=0' </script>";
        
        
}


?>